{extend name="public/base" /}

{block name="title"}<title>我参与的奖扣</title>{/block}

{block name="pjax_container"}
<style>
    .col-sm-2{
        width: 23.666667%;
        height: 33px;
        line-height: 40px;
        padding-top: 15px;
    }
    .col-sm-7{
        padding-top: 15px;
    }
</style>
<section class="content-header">
    <h4>我参与的奖扣</h4>
    <ol class="breadcrumb">
        <li class="active"><i class="fa fa-dashboard"></i> 我参与的奖扣</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                {include file="form_search/search_integral1" /}
                <div class="box-header with-border">
                    <div class="pull-left">
                        {:authAction(CONTROLLER_NAME.'/index_edit','create17')}
                        {:authAction(CONTROLLER_NAME.'/index_check_edit','create18')}
                        {:authAction(CONTROLLER_NAME.'/index','create5')}
                    </div>
                </div>
                <div class="box-body table-responsive">
                    <table class="table table-bordered table-hover">
                        <tr>
                            <!--<th width="35"><input type="checkbox" class="minimal checkbox-toggle"></th>-->
                            <th>奖扣时间</th>
                            <th>记录时间</th>
                            <th>事件名称</th>
                            <th>A分</th>
                            <th>B分</th>
                            <th>记录人</th>
                            <th>初审人</th>
                            <th>终审人</th>
                            <th>审核状态</th>
                        </tr>
                        {volist name="$list" id="v"}
                        <tr>
                            <!--<td><input type="checkbox" name="id[]" value="{$v.id}" class="minimal checkbox"></td>-->
                            <td>{:date('Y-m-d',$v["prize_buckle_time"])}</td>
                            <td>{:date('Y-m-d H:i',$v["create_time"])}</td>
                            <td><a href="{:url('integral/event_info',['id'=>$v.id])}">{$v["event_name"]}</a></td>
                            <td>{$v["integral_a"]}</td>
                            <td>{$v["integral_b"]}</td>
                            <td>{$v["r_name"]|default=''}</td>
                            <td>{$v["f_name"]|default=''}</td>
                            <td>{$v["l_name"]|default=''}</td>
                            <td>
                                {if condition="$v.status eq 0"}
                                待初审
                                {elseif condition="$v.status eq 1"}
                                待终审
                                {elseif condition="$v.status eq 2"}
                                审核通过
                                {elseif condition="$v.status eq 3"}
                                作废
                                {elseif condition="$v.status eq 4"}
                                拟稿
                                {/if}
                            </td>

                        </tr>
                        {/volist}
                    </table>
                </div>
                <div class="box-footer clearfix">
                    {$list->render()}
                </div>
            </div>
        </div>
    </div>
</section>
<script>
    $(function(){
        // 列表部分 全选
        $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
            checkboxClass: 'icheckbox_minimal-blue',
            radioClass: 'iradio_minimal-blue'
        });
        $('.checkbox-toggle').on('ifChecked', function(event){
            var _this = $(this);
            var _table = _this.closest('.table');
            _table.find("tr td input[type='checkbox']").iCheck("check");
        });
        $('.checkbox-toggle').on('ifUnchecked', function(event){
            var _this = $(this);
            var _table = _this.closest('.table');
            _table.find("tr td input[type='checkbox']").iCheck("uncheck");
        });
    });
    $('.index_recall').on('click',function () {
        var id = $(this).attr('data-id');
        var res= confirm('确定撤回么?')
        if(res===true) {
            $.ajax({
                url: '{:url("integral/index_del")}',
                type: 'get',
                dataType: 'json',
                data: {'id': id},
                success: function (data) {
                    $.amaran({'message': data.msg});
                    if (data.err == 0) {
                        window.location.reload()
                    }
                }
            });
        }
    });
</script>
{/block}
